package com.tj.collection.bean;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fqgj.common.api.Page;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 16/8/24
 * Time: 上午11:03
 */
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class ModuleResponse<T> {

    private Integer code = 0;

    private String msg = "SUCCESS";

    private T data;

    private Page page;

    public ModuleResponse() {
    }

    public ModuleResponse(T data) {
        this.data = data;
    }


    public ModuleResponse(T data, Page page) {
        Map<String, Object> map = new HashMap<>();
        this.data = data;
        this.page = page;
    }

    public Integer getCode() {
        return code;
    }

    public ModuleResponse setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ModuleResponse setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public ModuleResponse setData(T data) {
        this.data = data;
        return this;
    }


    public Page getPage() {
        return page;
    }

    public ModuleResponse setPage(Page page) {
        this.page = page;
        return this;
    }
}
